<template>
	<view class="content">
		<view class="status_bar">
			<!-- 这里是状态栏 -->
		</view>
		<search-box></search-box>
		<rotation-chart :imgArr="imgArr"></rotation-chart>
		<function-sort :functionSortArr="functionSortArr"></function-sort>
		<recomend :Rebooks="Rebooks"></recomend>

		<block v-for="(item, index) in bookResources" :key="index">
			<list-header>
				<text slot="title">{{item.headerTitle}}</text>
			</list-header>
			<book-list :bookListArr="item.books"></book-list>
		</block>
		<!--音频播放器-->
		<myaudio></myaudio>

		<!--占位符，高度与myaudio相同-->
		<view style="height: 160rpx;"></view>
	</view>
</template>

<script>
	import searchBox from "@/components/searchBox.vue"
	import rotationChart from "@/components/rotationChart.vue"
	import functionSort from "@/components/functionSort.vue"
	import recomend from "@/components/compound/recomend.vue"
	import listHeader from "@/components/listHeader.vue"
	import bookList from "@/components/bookList.vue"
	import myaudio from "@/components/myaudio.vue"

	export default {
		data() {
			return {
				imgArr: [],
				functionSortArr: [{
						iconId: 'icon-icon-test',
						iconColor: 'text-warning',
						name: '看榜单'
					},
					{
						iconId: 'icon-startRead',
						iconColor: 'text-hover-primary',
						name: '听小说'
					},
					{
						iconId: 'icon-icon09',
						iconColor: 'text-light-black',
						name: '听音乐'
					},
					{
						iconId: 'icon-zhishi',
						iconColor: 'text-success',
						name: '听知识'
					}
				],
				Rebooks: [],
				bookResources: []
			}
		},
		components: {
			searchBox,
			rotationChart,
			functionSort,
			recomend,
			listHeader,
			bookList,
			myaudio
		},
		onLoad() {
			this.$http.get('/app_index').then(res => {
				this.imgArr = res.swiperImages;
				this.Rebooks = res.Rebooks;
				this.bookResources = res.bookResources
			})
		},
		methods: {

		}
	}
</script>

<style>

</style>
